<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>发布</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="css/weui.css">
    <link rel="stylesheet" href="css/jquery-weui.css">
    <link rel="stylesheet" href="css/style.css">
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.2&key=fc8d203edc94af7f4fe3a3f02fb99a74"></script>
    
<style type="text/css">
.picker-button{font-size: 15px;}
</style>
</head>
<body class="back1">

    <div class="index-top">
        <div class="index-back" onClick="javascript:history.back(-1);">
            <img src="images/back.png" width="15">
        </div>
        <p class="index-title">发布行程</p>
    </div>

    <!-- 这里写内容 -->
    <div style="margin-top: 45px;">
    </div>

    <div class="index-box release-cont">
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <span class="dian"></span>
                </div>
                <div class="weui-cell__bd">
                    <p class="f15 open-popup" id="addressStart">周口市 · 初心法式甜点</p>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <span class="dian2"></span>
                </div>
                <div class="weui-cell__bd">
                    <p class="f15 open-popup" id="addressEnd">周口市 · 周口火车站</p>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <img class="mr5" src="images/wait.png" width="8">
                </div>
                <div class="weui-cell__bd">
                    <p class="weui-input f15" id="time-format">出发时间</p>
                </div>
            </div>
            <div class="weui-cell cxyq">
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <img class="mr5" src="images/user2.png" width="8">
                    </div>
                    <div class="weui-cell__bd">
                        <p class="weui-input open-popup f15" id="half22" data-target="#half2" style="cursor: pointer;">乘车人数</p>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <img class="mr5" src="images/yaoqiu.png" width="8">
                    </div>
                    <div class="weui-cell__bd">
                        <p class="weui-input open-popup f15" id="cxyqPop1" data-target="#cxyqPop" style="cursor: pointer;">出行要求</p>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
    <div id="travelPopupBox" style="display: none;">
        <div class="travelPopupS"></div>
        <div class="travelPopup">默认由车主选择路线并承担高速费<br>如你要求走高速，请注明</div>
    </div>

    <!--你从哪儿出发-->
    <div id="addressStartAll" class="weui-popup__container popup-address">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">
            <div class="popup-address-search">
                <div class="address">
                    <span>周口</span>
                    <img src="images/xia.png" width="20">
                </div>
                <input type="text" id="addressText1" placeholder="你从哪儿出发" name="addressText" onfocus='this.value=""'>
                <a href="javascript:;" class="close-popup" id="aaa">取消</a>
            </div>
        </div>
    </div>
    <!--你要去哪儿-->
    <div id="addressStartAll2" class="weui-popup__container popup-address">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">
            <div class="popup-address-search">
                <div class="address">
                    <span>周口</span>
                    <img src="images/xia.png" width="20">
                </div>
                <input type="text" id="addressText2" placeholder="你要去哪儿" name="addressText" onfocus='this.value=""'>
                <a href="javascript:;" class="close-popup" id="aaa2">取消</a>
            </div>
        </div>
    </div>

    <!--从哪儿出发-->
    <div>
    <!--<div id="addressStartAll" class="weui-popup__container popup-address">-->
        <!--<div class="weui-popup__overlay"></div>-->
        <!--<div class="weui-popup__modal">-->
            <!--<div class="popup-address-search">-->
                <!--<div class="address">-->
                    <!--<span>周口</span>-->
                    <!--<img src="images/xia.png" width="20">-->
                <!--</div>-->
                <!--<input type="text" id="addressText" placeholder="你从哪儿出发">-->
                <!--<a href="#" id="aaa">取消</a>-->
            <!--</div>-->
            <!--<div class="index-box">-->
                <!--<div class="weui-cells addressList">-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div><div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!---->
        <!--</div>-->
    <!--</div>-->
    <!--&lt;!&ndash;你要去哪儿&ndash;&gt;-->
    <!--<div id="addressStartAll2" class="weui-popup__container popup-address">-->
        <!--<div class="weui-popup__overlay"></div>-->
        <!--<div class="weui-popup__modal">-->
            <!--<div class="popup-address-search">-->
                <!--<div class="address">-->
                    <!--<span>周口</span>-->
                    <!--<img src="images/xia.png" width="20">-->
                <!--</div>-->
                <!--<input type="text" id="addressText2" placeholder="你要去哪儿">-->
                <!--<a href="#" id="aaa2">取消</a>-->
            <!--</div>-->
            <!--<div class="index-box">-->
                <!--<div class="weui-cells addressList">-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div><div class="weui-cell">-->
                    <!--<div class="weui-cell__hd">-->
                        <!--<img class="mr5" src="images/wait.png" width="8">-->
                    <!--</div>-->
                    <!--<div class="weui-cell__bd">-->
                        <!--<p class="f15 p1">周口火车站-进站口</p>-->
                        <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                    <!--</div>-->
                <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="weui-cell">-->
                        <!--<div class="weui-cell__hd">-->
                            <!--<img class="mr5" src="images/wait.png" width="8">-->
                        <!--</div>-->
                        <!--<div class="weui-cell__bd">-->
                            <!--<p class="f15 p1">周口火车站-进站口</p>-->
                            <!--<p class="f15 p2">河南省周口市川汇区周口火车站-进站口</p>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->

        <!--</div>-->
    <!--</div>-->
    </div>

    <div class="release-bottom">
        <div class="index-box" style="margin-bottom: 10px;">
            <div class="bx">
                <p>保险：5<span class="small">元</span></p>
                <p class="" style="font-size:12px;color: #b3b3b3;margin-top: 10px;">全面的贴心保障，让您的出行后顾无忧。</p>
            </div>
        </div>
        <a href="等待接单.html" class="weui-btn qrfb-btn">确认发布</a>
    </div>

    <!-- 乘车人数popup -->
    <div id="half2" class="weui-popup__container popup-bottom popup-people">
        <div class="weui-popup__modal">
            <div class="toolbar f15">
              <div class="toolbar-inner">
                <a href="javascript:;" class="picker-button close-popup" id="okFonPeople">完成</a>
                <h1 class="title f15">乘车人数</h1>
              </div>
            </div>
            <div class="modal-content" >
                <div class="weui-cells f15 ccPeople">
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <div class="price">成人

                                <label class="weui-cell weui-check__label" for="preWoman">
                                    <div class="weui-cell__hd weui-cells_checkbox">
                                        <input type="checkbox" class="weui-check" name="checkbox1" id="preWoman">
                                        <i class="weui-icon-checked" style="margin-left: -5px;"></i>
                                    </div>
                                    <div class="weui-cell__bd">
                                        <p class="fs12">有孕妇</p>
                                    </div>
                                </label>
                            </div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="quantity">
                                <a href="javascript:void(0);" class="subtract ca weui-count__decrease" id="adult">-</a><input type="tel" value="1" class="nums weui-count__number" id="nums1"><a href="javascript:void(0);" class="plus weui-count__increase">+</a>
                            </div>
                        </div>
                    </div>
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                          <div class="price">儿童<span class="fs12"> 4-12岁</span></div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="quantity">
                                <a href="javascript:void(0);" class="subtract ca weui-count__decrease">-</a><input type="tel" value="0" class="nums weui-count__number" id="nums2"><a href="javascript:void(0);" class="plus weui-count__increase">+</a>
                            </div>
                        </div>
                    </div>
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                          <div class="price">婴幼儿<span class="fs12"> 0-3岁</span></div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="quantity">
                                <a href="javascript:void(0);" class="subtract ca weui-count__decrease">-</a><input type="tel" value="0" class="nums weui-count__number" id="nums3"><a href="javascript:void(0);" class="plus weui-count__increase">+</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 出行要求 -->
    <!-- <div class="weui-popup__overlay close-popup"></div> -->
    <div id="cxyqPop" class="weui-popup__container popup-bottom popup-people">
        <div class="weui-popup__modal">
            <div class="toolbar f15">
              <div class="toolbar-inner">
                <a href="javascript:;" class="picker-button close-popup" id="okFonChuxing">完成</a>
                <h1 class="title f15">出行要求</h1>
              </div>
            </div>
            <div class="modal-content travelRequ">
                <div class="dengpao">
                    <img src="images/dengpao.png" width="10">
                    <p>填写下列信息，方便车主与您沟通</p>
                </div>
                <div class="beizhu" id="beizhu">
                    <a href="javascript:;" vcode="0">有宠物</a>
                    <a href="javascript:;" vcode="1">有大件行李</a>
                    <a href="javascript:;" vcode="2">需走高速，高速费由我承担</a>
                </div>
                <a href="javascript:;" class="weui-btn weui-btn_primary qrtj-btn" id="qrtj-btn">无特殊要求</a>
            </div>
        </div>
    </div>
    <input type="hidden" id="beizhuValue">

    <script src="js/jquery.min.js"></script>
    <script src="js/jquery-weui.min.js"></script>
    <script src="js/store.js"></script>
    <style>
        .demos-content-padded{padding:15px}
        .amap-sug-result{width:94%;left: 3%!important;border:0;background:#fff;border-radius: 2px;box-shadow:0px 0px  10px 3px #e7e7e7;top:46px;}
        .auto-item-span{display:block;padding-left:0;font-size: 13px;color:#939393;}
        .auto-item{background: url("images/wait.png") no-repeat left 7% center;background-size: auto 17%;padding-left:12%;font-size: 15px;line-height: 24px;border-bottom: 1px solid #e5e5e5;}
    </style>
<script>
    console.log(store.get('dataStore'));
    var dataStore = store.get('dataStore');
    $("#addressStart").text(dataStore.begin_detail);
    $("#addressEnd").text(dataStore.end_detail);
    // store.remove('dataStore'); //清楚缓存

    // 计算人数
    var MAX = 4, MIN = 1, MIN2 = 0;
    $('.weui-count__decrease').click(function (e) { // 最小为1时
        var $input = $(e.currentTarget).parent().find('.weui-count__number');
        var number = parseInt($input.val() || "0") - 1;
        if (number < MIN2) number = MIN2;
        if (number == MIN2) $(e.currentTarget).parent().find('.weui-count__decrease').addClass("ca");
        $input.val(number);
        $('.weui-count__increase').removeClass("ca");
    });
    $('#adult').click(function (e) {// 最小为0时
        var $input = $(e.currentTarget).parent().find('.weui-count__number');
        var number = parseInt($input.val() || "0") - 1;
        if (number < MIN) {
            number = MIN;
            $(e.currentTarget).parent().find('.weui-count__decrease').addClass("ca");
            $.toast("至少1位成人乘客", "text");
        }
        $input.val(number);
        $('.weui-count__increase').removeClass("ca");
    });
    $('.weui-count__increase').click(function (e) { // 加
        var nums = parseInt($("#nums1").val()) + parseInt($("#nums2").val()) + parseInt($("#nums3").val());
        var $input = $(e.currentTarget).parent().find('.weui-count__number');
        var number = parseInt($input.val() || "0") + 1;
        $(e.currentTarget).parent().find('.weui-count__decrease').removeClass("ca");
        if (number > MAX) {
            $input.val(MAX);
            $.toast("最多4人乘车", "text");
            console.log($(this).attr("class"));
            return false;
        }
        if (number == MAX || MAX - nums == 1) $(".weui-count__increase").addClass("ca");
        if (MAX - nums > 0) $input.val(number);
        else $.toast("最多4人乘车", "text");
    });

    // 出发时间
    $("#time-format").datetimePicker({
        toolbarCloseText: '下一步',
        title: '出发时间',
        yearSplit: '',
        monthSplit: '月',
        dateSplit: '日',
        years: function () {
            return [{values:""}]
        },
        monthes: ['5', '6'], //当前和下个月份
        times: function () {
          return [  // 自定义的时间
            {
              values: (function () {
                var hours = [];
                for (var i=0; i<24; i++) hours.push(i > 9 ? i : '0'+i);
                return hours;
              })()
            },
            {
              divider: true,  // 这是一个分隔符
              content: ':'
            },
            {
              values: (function () {
                var minutes = [];
                for (var i=0; i<59; i++){
                    minutes.push(i > 9 ? i : '0'+i);
                }
                return minutes;
              })()
            },
            {
              divider: true,  // 这是一个分隔符
              content: ''
            }
          ];
        },
        onChange: function (picker, values, displayValues) {
          console.log(values['3']);
          // 从values数组里取时间
            $("#time-format").text(values['1']+'月'+values['2']+'日 '+values['3']+':'+values['4'])
        },
        onClose: function (picker, values, displayValues){
            console.log(picker+'++'+values+"=="+displayValues);
        }
    });
    // 选择时间后下一步
    $(document).on("click",".close-picker",function(){
        if($("#half22").text() == "乘车人数"){
            $("#half22").click();
        }
    });

    // 乘车人数计算
    $(document).on("click","#okFonPeople",function(){
        var nums = parseInt($("#nums1").val()) + parseInt($("#nums2").val()) + parseInt($("#nums3").val());
        $("#half22").text(nums+"人");

        // 出行要求提示定时 显示隐藏
        $("#travelPopupBox").show();
        var t=setTimeout(function(){
            $("#travelPopupBox").hide();
        },5000);
    });

    
    // 出行要求
    var beizhuVal = [];// 存放出行要求的数组
    $.each($("#beizhu a"),function(k,v){
        $(v).click(function(){
            if($(this).hasClass("cur")){
                $(this).removeClass("cur");
                for(i in beizhuVal){
                    if($(this).attr("vcode") == beizhuVal[i]){
                        beizhuVal.splice(i, 1);
                    }
                }
                console.log(beizhuVal)
            }else{
                $(this).addClass("cur");
                beizhuVal.push($(this).attr("vcode"));
                
            }
            $("#beizhuValue").val(beizhuVal);
            if (beizhuVal.length > 0) {
                $("#qrtj-btn").text("确认添加");
            }else{
                $("#qrtj-btn").text("无特殊要求");
            }
        });
    });
    $(document).on("click","#qrtj-btn",function(){
        $("#okFonChuxing").click();
    });
    $(document).on("click","#okFonChuxing",function(){
        if (beizhuVal.length > 0) {
            $("#cxyqPop1").text("已添加");
        }
    });
           
    
    // 打开地址popup-起点
    $(document).on("click", "#addressStart", function() {
        $("#addressStartAll").popup();
    });
    // 关闭地址popup-起点
    $(document).on("click", "#aaa", function() {
        $.closePopup("#addressStartAll");
    });

    // 打开地址popup-终点
    $(document).on("click", "#addressEnd", function() {
        $("#addressStartAll2").popup();
    });
    // 关闭地址popup-终点
    $(document).on("click", "#aaa2", function() {
        $.closePopup("#addressStartAll2");
    });

    // 点击关闭地址popup-起点
    // $("#addressStartAll").find(".weui-cell").click(function () {
    //     $.closePopup("#addressStartAll");
    // });
    // // 点击关闭地址popup-终点
    // $("#addressStartAll2").find(".weui-cell").click(function () {
    //     $.closePopup("#addressStartAll2");
    // });
    // 选择地址
    var beginPlace, beginDetail, endPlace, endDetail, lonlatBegin, lonlatEnd;
    var map = new AMap.Map("mapContainer", {
        resizeEnable: true,
        center: [114.689762, 33.641854],		// 地图中心点
        zoom: 13,								// 地图显示的缩放级别
        keyboardEnable: false
    });
    AMap.plugin(['AMap.Autocomplete','AMap.PlaceSearch'],function(){
        var placeSearch = new AMap.PlaceSearch({
            city:'周口',
            map:map
        })
        // 你从哪儿出发
        var autoOptions = {
            city: "周口", 								// 城市，默认全国
            input: "addressText1"						// 使用联想输入的input的id
        };
        autocomplete= new AMap.Autocomplete(autoOptions);
        AMap.event.addListener(autocomplete, "select", function(e){
            placeSearch.setCity(e.poi.adcode);
            placeSearch.search(e.poi.name);
            console.log(e);
            $.closePopup("#addressStartAll");
            $("#addressStart").text(e.poi.name);
            $("#addressStart").attr("vname", e.poi.name);
            $("#addressStart").attr("vlng", e.poi.location.lng);//经度
            $("#addressStart").attr("vlat", e.poi.location.lat);//纬度
        });

        // 你要去哪儿
        var autoOptions2 = {
            city: "周口", 								// 城市，默认全国
            input: "addressText2"						// 使用联想输入的input的id
        };
        autocomplete= new AMap.Autocomplete(autoOptions2);
        AMap.event.addListener(autocomplete, "select", function(e){
            $.closePopup("#addressStartAll2");
            $("#addressEnd").text(e.poi.name);
            $("#addressEnd").attr("vname", e.poi.name);
            $("#addressEnd").attr("vlng", e.poi.location.lng);//经度
            $("#addressEnd").attr("vlat", e.poi.location.lat);//纬度
            beginPlace = "周口",
                beginDetail = $("#addressStart").attr("vname"),
                endPlace = "周口",
                endDetail = $("#addressEnd").attr("vname"),
                lonlatBegin = {
                    lng: $("#addressStart").attr("vlng"),
                    lat: $("#addressStart").attr("vlat")
                },
                lonlatEnd = {
                    lng: $("#addressEnd").attr("vlng"),
                    lat: $("#addressEnd").attr("vlat")
                };
            var dataStore = {
                type: "1",// 1乘客 2载客
                region: "2",// 0本市 1跨市
                begin_place: beginPlace,// 起点位置
                begin_detail: beginDetail,// 起点位置详细地址
                end_place: endPlace,// 终点位置
                end_detail: endDetail,// 终点位置详细地址
                lonlat_begin: lonlatBegin,// 起点经纬度
                lonlat_end: lonlatEnd,// 终点经纬度
            }
            store.set("dataStore", dataStore);
            console.log(store.get('dataStore'));
        });
    });
    store.claim()

</script>
    <script type="text/javascript" src="https://webapi.amap.com/demos/js/liteToolbar.js"></script>
</body>
</html>

